package com.chengfei.spring.cloud.weather.service;

import com.chengfei.spring.cloud.weather.vo.Forecast;
import com.chengfei.spring.cloud.weather.vo.Weather;
import org.springframework.stereotype.Service;

import java.util.ArrayList;
import java.util.List;

/**
 * @author chengfei cheng.fei@chinaott.onaliyun.com
 **/
@Service
public class WeatherReportServiceImpl implements WeatherReportService{
    @Override
    public Weather getDataByCityId(String cityId) {
        //TODO 改为由天气数据api微服务提供
        Weather weather = new Weather();
        weather.setAqi("81");
        weather.setCity("深圳");
        weather.setGanmao("容易感冒");
        weather.setWendu("22");
        List<Forecast> forecasts = new ArrayList<>();

        Forecast forecast = new Forecast();
        forecast.setDate("23日星期五");
        forecast.setType("晴");
        forecast.setFengxiang("无风");
        forecast.setHigh("高温11度");
        forecast.setLow("低温1度");
        forecasts.add(forecast);

        forecast = new Forecast();
        forecast.setDate("24日星期五");
        forecast.setType("晴");
        forecast.setFengxiang("无风");
        forecast.setHigh("高温11度");
        forecast.setLow("低温1度");
        forecasts.add(forecast);

        forecast = new Forecast();
        forecast.setDate("25日星期五");
        forecast.setType("晴");
        forecast.setFengxiang("无风");
        forecast.setHigh("高温11度");
        forecast.setLow("低温1度");
        forecasts.add(forecast);

        forecast = new Forecast();
        forecast.setDate("26日星期五");
        forecast.setType("晴");
        forecast.setFengxiang("无风");
        forecast.setHigh("高温11度");
        forecast.setLow("低温1度");
        forecasts.add(forecast);

        forecast = new Forecast();
        forecast.setDate("27日星期五");
        forecast.setType("晴");
        forecast.setFengxiang("无风");
        forecast.setHigh("高温11度");
        forecast.setLow("低温1度");


        forecasts.add(forecast);

        weather.setForecast(forecasts);

        return weather;

    }
}
